package com.wing.wcabinet.model.entity;

import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.wing.mybatis.common.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.math.BigDecimal;

/**
 * 调拨明细
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("wcab_cell_allocation_detail")
public class WcabCellAllocationDetail extends BaseEntity<WcabCellAllocationDetail> implements Serializable {

    private static final long serialVersionUID = 1L;

    public enum Type implements IEnum<Integer> {

        /**
        * 部分调动
        */
        part(0,"部分调动"),
        /**
        * 整体调动
        */
        all(1,"整体调动");

        private int code;
        private String desc;

        Type(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    public enum BusinessType implements IEnum<Integer> {


        normal(1,"正常"),
        /**
         * 维修
         */
        repair(2,"维修"),
        /**
         * 报废
         */
        recycle(3,"报废");

        private int code;
        private String desc;

        BusinessType(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    private BusinessType businessType;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 调拨id
     */
    private Long allocationId;

    /**
     * 调拨数量
     */
    private Integer quantity;

    /**
     * 调拨重量
     */
    private BigDecimal weight;

    /**
     * 柜子编码
     */
    private String cabCode;

    /**
     * 货道编号
     */
    private String spaceCode;

    /**
     * skuCode
     */
    private String skuCode;

    /**
     * 柜子id
     */
    private Long cabId;

    /**
     * 货道id
     */
    private Long spaceId;

    /**
     * sku id
     */
    private String skuId;

    /**
     * 模板柜子code
     */
    private String cabCodeTarget;

    /**
     * 模板柜子id
     */
    private Long cabIdTarget;

    /**
     * 模板货道code
     */
    private String spaceCodeTarget;

    /**
     * 目标货道id
     */
    private Long spaceIdTarget;

    /**
     * 调拨方式
     */
    private Type type;

    /**
    * 调拨方式描述
    */
    @TableField(exist = false)
    private String typeDesc;

    public String getTypeDesc() {
        return type == null ? null : type.getDesc();
    }

    private String enterpriseCode;

}
